﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ExcelUtil
{
    public class Util
    {
        public static string openFileDialog(string selectedPath = "", string description = "选择文件夹")
        {
            FolderBrowserDialog openFileDialog = new System.Windows.Forms.FolderBrowserDialog();  //选择文件夹
            openFileDialog.SelectedPath = selectedPath;
            openFileDialog.Description = description;
            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)//注意，此处一定要手动引入System.Window.Forms空间，否则你如果使用默认的DialogResult会发现没有OK属性
            {
                return openFileDialog.SelectedPath;
            }
            else
            {
                return "";
            }
        }
    }
}
